/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.tomasio.projects.welcome;

import com.tomasio.projects.welcome.dao.DAOFactory;
import com.tomasio.projects.welcome.dao.ProibicaoDeAcessoDAO;
import com.tomasio.projects.welcome.dto.ProibicaoDeAcessoDTO;
import com.tomasio.projects.welcome.interfaces.ProibicaoService;
import com.tomasio.projects.welcome.util.DAOUtil;
import java.util.List;

/**
 *
 * @author administrador
 */
public class SimpleProibicaoService implements ProibicaoService{
    private DAOFactory factory = DAOUtil.getDAOFactory();
    @Override
    public void createProibicaoDeAcesso(ProibicaoDeAcessoDTO proibicao) {
        ProibicaoDeAcessoDAO dao = factory.getProibicaoDeAcessoDAO();
        dao.create(proibicao);
    }

    @Override
    public void updateProibicaoDeAcesso(ProibicaoDeAcessoDTO proibicao) {
        ProibicaoDeAcessoDAO dao = factory.getProibicaoDeAcessoDAO();
        dao.update(proibicao);
    }

    @Override
    public void removeProibicaoDeAcesso(Long id) {
        ProibicaoDeAcessoDAO dao = factory.getProibicaoDeAcessoDAO();
        dao.remove(id);
    }

    @Override
    public ProibicaoDeAcessoDTO findProibicaoDeAcesso(Long id) {
        ProibicaoDeAcessoDAO dao = factory.getProibicaoDeAcessoDAO();
        return dao.find(id);
    }

    @Override
    public List<ProibicaoDeAcessoDTO> findAllProibicoesDeAcesso() {
        ProibicaoDeAcessoDAO dao = factory.getProibicaoDeAcessoDAO();
        return dao.findAll();
    }

}
